﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;

namespace BLL.CarriersBLL
{
    public class CarriersHome
    {
        private readonly CarrierListRepository _carrierListRepository = new CarrierListRepository();
        private readonly DurableSpecRepository _durableSpecRepository = new DurableSpecRepository();
        private readonly CarrierRepository _carrierRepository = new CarrierRepository();
        private readonly BatchRepository batchRepository = new BatchRepository();

        // 获取所有载具列表记录
        public List<CarrierList> GetAllCarrierLists()
        {
            return _carrierListRepository.GetAllCarrierLists();
        }
        // 根据ID获取单个载具列表记录
        public CarrierList GetCarrierListById(int carrierListId)
        {
            return _carrierListRepository.GetCarrierListById(carrierListId);
        }
        //  根据ID获取耐用品表记录
        public DurableSpec GetDurableById(int durableId)
        {
            return _durableSpecRepository.GetDurableSpecById(durableId);
        }
        //  根据ID获取批次表记录
        public Batch GetBatchById(int batchId) 
        {
            return batchRepository.GetBatchById(batchId);
        }
        public List<Dictionary<string,object>> test(
            string detailedCarrierType = null,
            string capacityStatus = null,
            string cleaningStatus = null,
            string carrierStatus = null,
            int? carrierId = null,
            int? durableSpecId = null)
        {
            return _carrierListRepository.SearchCarrierLists(detailedCarrierType, capacityStatus, cleaningStatus, carrierStatus, carrierId, durableSpecId);
        }
    }
}
